<?php
$bookingItem = new BWInputValue($bookingId);
$cartTable = new BWCart();
$bookingRow = new BTreeList($bookingItem);
$cartRow = $cartTable->getListById($cartId);

$venderName = $bookingRow->getItem('venderName')->value;
$courtName = $bookingRow->getItem('courtName')->value;
$startTime = $bookingRow->getItem('startTime')->value;
$endTime = $bookingRow->getItem('endTime')->value;
$paidTime = $bookingRow->getItem('paidTime')->value;
$price = $cartRow->getItem('price')->value;
$quantity = $cartRow->getItem('quantity')->value;
?>


<legend> 
    取消预订
</legend>


<div class="form" style="padding-left: 30px">    
    <p><strong>场地商：</strong><span class="text-warning"><?php echo $venderName; ?></span></p>
    <p><strong>场地名称：</strong><span class="text-warning"><?php echo $courtName; ?></span></p>
    <p><strong>开始时间：</strong><span class="text-warning"><?php echo date('Ymd-G:i:s', $startTime); ?></span></p>
    <p><strong>结束时间：</strong><span class="text-warning"><?php echo date('Ymd-G:i:s', $endTime); ?></span></p>
    <p><strong>单价：</strong><span class="text-primary"><?php echo $price; ?></span></p>
    <p><strong>数量：</strong><span class="text-primary"><?php echo $quantity; ?></span></p>
    <p>
        <?php
        if (Blyn::app()->getUIManager()->getSenderControl()->isAjaxLinkClicked('cancelBookingNow')) {
            ?>
        <div class="well text-danger"><p>你已经取消了你的预订！</p>
            <p>取消的订单号：<?php echo $bookingId; ?></p>
            <p>返回订金：<?php echo $price * $quantity; ?> 元</p>
            <p>进入我的订单记录查看结果！</p></div>
        <?php
    } else {
        echo $control->getAjaxLink(array('name' => '确认取消', 'id' => 'cancelBookingNow'), array(
            'cartId' => $cartId,
            'bookingId' => $bookingId,
            'htmlOptions' => array('class' => 'btn')));
    }
    ?>
</p>
</div>

